package com.example.everying.framework.ai.deepseek;

import lombok.Getter;
import org.springframework.http.HttpStatusCode;

@Getter
public class DeepSeekException extends RuntimeException {
    private final HttpStatusCode statusCode;

    public DeepSeekException(HttpStatusCode statusCode, String message) {
        super(message);
        this.statusCode  = statusCode;
    }
}
//// 使用方式
//.onStatus(HttpStatus::isError, response ->
//        response.bodyToMono(String.class)
//        .flatMap(body -> Mono.error(new  DeepSeekException(
//        response.statusCode(),
//            "DeepSeek API error: " + body
//        )))
//                )